<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<canvas id="c1" width="500" height="500">
			不支持canvas
		</canvas>
		
		<script type="text/javascript">
			function makeLine(callback){
				let c1=document.createElement('canvas')
				c1.width=c1.height=500
				console.log(c1);
				var pen=c1.getContext('2d')
				callback(pen)
				pen.stroke()
				document.body.appendChild(c1)
			}
			
			makeLine(pen=>{
				pen.font="80px 黑体"
				pen.shadowBlur=10
				pen.shadowColor='black'
				pen.shadowOffsetX=5
				pen.shadowOffsetY=5
				let x=0
				setInterval(()=>{
					if(x>500)
						x=-100
					pen.clearRect(0,0,500,500)
					// pen.fillText('？？搜索',100,100)
					pen.strokeText('？？搜索',x,100)
					x+=10
				},20)
				
			})
		</script>
	</body>
</html>
